package es.uniovi.miw.tfm.scowt.core;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import es.uniovi.miw.tfm.scowt.api.CompetenceService;
import es.uniovi.miw.tfm.scowt.model.Competence;
import es.uniovi.miw.tfm.scowt.model.Skill;
import es.uniovi.miw.tfm.scowt.stores.dao.CompetenceDao;

/**
 * Implementation of <code>CompetenceService</code>
 * 
 * @author alexalvarez87
 * 
 */
@Component
public class CompetenceServiceImpl implements CompetenceService {

    private Log logger = LogFactory.getLog(getClass());
    
    @Autowired
    private CompetenceDao competenceDao;

    @Override
    public List<Competence> getAllCompetencies() {
	return competenceDao.getAllCompetencies();
    }

    @Override
    public Competence getCompetenceDetail(String competenceId) {
	//FIXME: Sure??
	Integer level = null;
	return competenceDao.findCompetenceByIdAndLevel(competenceId, level);
    }

    @Override
    public void addSkill(Skill skill) {
	logger.error("addSkill() not implemented");
	throw new UnsupportedOperationException();
    }

}
